﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_ActsAsSpare association indicates which elements can be spares or replace other aggregated elements. A spare can operate in "hot-standby" mode as specified on an element-by-element basis. 
    /// </summary>
    public class CIM_ActsAsSpare
    {
        private CIM_SpareGroup _Group;
        private Nullable<Boolean> _HotStandby;
        private CIM_ManagedSystemElement _Spare;

        /// <summary>
        /// Reference to the Group property that represents the CIM_SpareGroup class.
        /// </summary>
        public CIM_SpareGroup Group { get { return _Group; } }

        /// <summary>
        /// If TRUE, the spare is operating as a hot standby.
        /// </summary>
        public Nullable<Boolean> HotStandby { get { return _HotStandby; } }

        /// <summary>
        /// Reference to a managed system element acting as a spare and participating in the spare group.
        /// </summary>
        public CIM_ManagedSystemElement Spare { get { return _Spare; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_ActsAsSpare(ManagementBaseObject mbo) //TODO fix
        {
            _Group = new CIM_SpareGroup(mbo);
            _HotStandby = mbo.GetBoolValue("HotStandby");
            _Spare = new CIM_ManagedSystemElement(mbo);
        }

    }
}
